package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SrRoomMapper;
import com.ruoyi.system.domain.SrRoom;
import com.ruoyi.system.service.ISrRoomService;

/**
 * 自习室Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-04
 */
@Service
public class SrRoomServiceImpl implements ISrRoomService 
{
    @Autowired
    private SrRoomMapper srRoomMapper;

    /**
     * 查询自习室
     * 
     * @param roomId 自习室主键
     * @return 自习室
     */
    @Override
    public SrRoom selectSrRoomByRoomId(Long roomId)
    {
        return srRoomMapper.selectSrRoomByRoomId(roomId);
    }

    /**
     * 查询自习室列表
     * 
     * @param srRoom 自习室
     * @return 自习室
     */
    @Override
    public List<SrRoom> selectSrRoomList(SrRoom srRoom)
    {
        return srRoomMapper.selectSrRoomList(srRoom);
    }

    /**
     * 新增自习室
     * 
     * @param srRoom 自习室
     * @return 结果
     */
    @Override
    public int insertSrRoom(SrRoom srRoom)
    {
        srRoom.setCreateTime(DateUtils.getNowDate());
        return srRoomMapper.insertSrRoom(srRoom);
    }

    /**
     * 修改自习室
     * 
     * @param srRoom 自习室
     * @return 结果
     */
    @Override
    public int updateSrRoom(SrRoom srRoom)
    {
        srRoom.setUpdateTime(DateUtils.getNowDate());
        return srRoomMapper.updateSrRoom(srRoom);
    }

    /**
     * 批量删除自习室
     * 
     * @param roomIds 需要删除的自习室主键
     * @return 结果
     */
    @Override
    public int deleteSrRoomByRoomIds(Long[] roomIds)
    {
        return srRoomMapper.deleteSrRoomByRoomIds(roomIds);
    }

    /**
     * 删除自习室信息
     * 
     * @param roomId 自习室主键
     * @return 结果
     */
    @Override
    public int deleteSrRoomByRoomId(Long roomId)
    {
        return srRoomMapper.deleteSrRoomByRoomId(roomId);
    }
}
